.TH std::basic_stacktrace::empty 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::basic_stacktrace::empty \- std::basic_stacktrace::empty

.SH Synopsis
   [[nodiscard]] bool empty() const noexcept;  (since C++23)

   Checks if the stacktrace has no stacktrace entries.

.SH Parameters

   \fI(none)\fP

.SH Return value

   true if the stacktrace is empty, false otherwise.

.SH Complexity

   Constant.

.SH Example


// Run this code

 #include <stacktrace>
 #include <iostream>

 int main()
 {
     std::cout << std::boolalpha;
     std::stacktrace bktr;
     std::cout << "Initially, bktr.empty(): " << bktr.empty() << '\\n';

     bktr = std::stacktrace::current();
     std::cout << "After getting entries, bktr.empty(): " << bktr.empty() << '\\n';
 }

.SH Possible output:

 Initially, bktr.empty(): true
 After getting entries, bktr.empty(): false

.SH See also

   size returns the number of stacktrace entries
        \fI(public member function)\fP
